<?php
// +----------------------------------------------------------------------
// | ManniuRead
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://manniuyun.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: heitao <mall@manniuyun.com>
// +----------------------------------------------------------------------

namespace app\mall\controller\admin;

use app\mall\base\MallAdminBase;

use app\mall\model\MallOrder as MallOrderModel;

class Order extends MallAdminBase{
    //当前控制器菜单
    public $submenu = [];

    /**
     * TP初始化方法
     */
    public function _initialize() {
        parent::_initialize();
        $this->submenu[] = ['title' => '订单列表', 'url' => url('mall/admin.order/index'), 'icon' => '&#xe60a;'];
        /*
        $this->submenu[] = ['title' => '添加商品', 'url' => url('mall/admin.order/add'), 'icon' => '&#xe608;'];
        */
    }

    /**
     * 商城订单列表
     * @access public
     * @return \think\Response
     */
    public function index(){
        $list = MallOrderModel::order('id desc')->paginate(config('mn_admin.admin_pagesize'));
        $this->assign([
            'submenu' => $this->submenu,
            'list' => $list
        ]);
        return $this->fetch();
    }
}